/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package br.pb.sistcomp.util;

import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;
//import javax.persistence.Persistence;

/**
 *
 * @author georgelima1
 */
public class HibernateUtil {
    private static HibernateUtil hu;
    private static EntityManagerFactory emf;

    private HibernateUtil(){
       emf = Persistence.createEntityManagerFactory("treinamentoPU");
    }

    public static HibernateUtil getInstance(){
        if(hu == null){
            hu = new HibernateUtil();
            return hu;
        }
        return hu;
    }

    public EntityManagerFactory getFactory(){
        return emf;
    }

}